package cn.edu.cdtu.yulei.test_demo.controller;

import cn.edu.cdtu.yulei.test_demo.model.User;
import cn.edu.cdtu.yulei.test_demo.service.impl.UserServiceImpl;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("/register")
public class RegisterController extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp){
        UserServiceImpl userService = new UserServiceImpl();
        User user = new User();
        user.setUserName(req.getParameter("userName"));
        user.setPassword(req.getParameter("password"));
        userService.insertUser(user);
    }
}
